package com.jone.comic_api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.framework.controller.AjaxResult;
import com.baomidou.mybatisplus.plugins.Page;
import com.jone.comic_api.entity.ComicBook;
import com.jone.comic_api.service.IComicBookService;

/**
 * <p>
 * 前端控制器
 * </p>
 * 
 * @author Yanghu
 * @since 2017-05-26
 */
@RestController
@RequestMapping("/comic/comicBook")
public class ComicBookController extends BaseController {

    @Autowired
    private IComicBookService comicBookService;

    @RequestMapping("/getBookList")
    public String getBookList() {
        Page<ComicBook> page = getPage(10);
        
        return callback(new AjaxResult(comicBookService.selectPage(page, null)));
    }
    
    @RequestMapping("/getBookInfo")
    public String getBookInfo( ComicBook book) {
        return callback(new AjaxResult( book.selectById()));
    }
    
 

}
